<SCRIPT LANGUAGE="JavaScript">  
    function validation()
    {
        var temp="";
        temp=document.getElementById('AdvImage');
        if( temp.value=='' )
        {
            alert('Masukkan gambar untuk iklan anda');
            return false;             
        }     


        temp=document.getElementById('AdvLink');
        if( temp.value.length == 0 || temp.value == 'http://')
        {
            temp.focus();
            temp.style.backgroundColor='#FF9';
            alert('Masukkan link untuk iklan anda');
            temp.style.backgroundColor='#FFF';
            return false;             
        }
    }        
</SCRIPT> 
<?php                                       
echo "<div class='form'>";
echo "<h2> Post a new Adv </h2>";
echo "<hr color='#2A7EF7'>";
    echo ":. Back to ".$html->link('[ Iklan Saya ]',array('controller'=>'advs','action'=>'my_advs'));
        echo "<div class='kotak2'>";
        echo $form->create('Adv',array('action'=>'post','type'=>'file','onsubmit'=>'return validation();'));
		        echo $form->input('image',array('type'=>'file','label'=>'Banner'));
                //echo "<div class='input'><label>&nbsp</label><span class='info'>The ideal dimension is 250 x 100 pixels</span></div>";
                echo $form->input('link',array('value'=>'http://','size'=>'40')); 
        echo "<div class='input'><label> &nbsp </label><input type='submit' value='Submit'></div>";
    echo "</form>";   
    echo "</div>"; 
    echo ":. Format file harus <span class='red'>Image (.jpg or .jpeg or .gif or .png) </span>";
    echo "<br>:. Ukuran foto yang dianjurkan adalah <span class='red'>250 x 100</span> pixel";
    echo "<br>:. URL link harus diawali dengan <span class='red'>'http://'</span>";  
     
echo "</div>";